﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Net_SCADA
{
    public class ProcessLoad
    {
        public DateTime LoadTime { get; set; }//第一次登录的时间
        public int BoxMark { get; set; }//时间标记  时 分
        public int BoxSerial { get; set; }//PLC内box index的标记
        public int BoxIndex { get; set; }//当前该物料所处的位置
        public StringBuilder BatchSerial { get; set; }//批次号
        public int LoadSerial { get { return BoxSerial * 10000 + BoxMark; } }

        public void EndProcessLoad()
        {
            StringBuilder sb=new StringBuilder();
            sb.Append("EndLoad: BoxSerial-").Append(BoxSerial).Append(",BoxMark-").Append(BoxMark).Append(",LoadTime-").Append(LoadTime);
            fdPublicFunction.SaveLog(5 , sb.ToString());
        }
        public void SaveProcessLoadToDB()
        {
            DBOperate.SaveProcessBoxInfo(BoxSerial , BoxMark , LoadTime , new Dictionary<string , string>() { { "batchserial" , BatchSerial.ToString() } });
        }
    }
}
